Inhibiting corrosion in gas wells

ABSTRACT

A composition for inhibiting corrosion in gas wells includes a pyrazolopyridine derivative. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety. The composition can be flowed into a wellbore formed in a subterranean formation, thereby inhibiting corrosion in the wellbore.

TECHNICAL FIELD

This disclosure relates to inhibiting corrosion in gas wells.

BACKGROUND

Corrosion can occur in oil and gas processing equipment and piping. Corrosion can occur due to factors such as temperature, the presence of carbon dioxide, the presence of hydrogen sulfide, the presence of electrolytes, and flow conditions. Corrosion can be detrimental if left untreated. For example, untreated corrosion can result in an asset becoming inefficient, unreliable, and in some cases, unsafe. A common solution is to use corrosion inhibitor, which can form a protective barrier against corrosive attack.

SUMMARY

This disclosure describes technologies relating to inhibiting corrosion in gas wells, and more specifically, inhibiting high temperature carbon dioxide corrosion in gas wells. Certain aspects of the subject matter can be implemented as a composition for inhibiting corrosion in gas wells. The composition includes a pyrazolopyridine derivative. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety.

This, and other aspects, can include one or more of the following features. In some implementations, the pyrazolopyridine derivative has a concentration in the composition in a range of from 100 parts per million (ppm) to 10,000 ppm. In some implementations, the phenyl moiety includes an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group. In some implementations, the R₁ group includes methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime. In some implementations, the first pyrazole moiety includes an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group. In some implementations, the second pyrazole moiety includes an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group.

Certain aspects of the subject matter can be implemented as a method. A composition is flowed into a wellbore formed in a subterranean formation, thereby inhibiting corrosion in the wellbore. The composition includes a pyrazolopyridine derivative. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety. A hydrocarbon is produced from the subterranean formation via the wellbore.

This, and other aspects, can include one or more of the following features. In some implementations, the pyrazolopyridine derivative has a concentration in the composition in a range of from 100 parts per million (ppm) to 10,000 ppm. In some implementations, the phenyl moiety includes an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group. In some implementations, the R₁ group includes methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime. In some implementations, the first pyrazole moiety includes an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group. In some implementations, the second pyrazole moiety includes an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group.

Certain aspects of the subject matter can be implemented as a method for producing a corrosion inhibitor for gas wells. Hydrazine hydrate and ethyl acetoacetate are mixed in ethanol to form a first mixture. The first mixture is exposed to ultrasound irradiation. An aldehyde and ammonium acetate are added to the first mixture to form a second mixture. The second mixture is exposed to ultrasound irradiation. Water is added to the second mixture to form a third mixture. The third mixture is exposed to ultrasound irradiation to form a precipitate. The precipitate is separated from the third mixture. The precipitate is crystallized using ethanol to form the corrosion inhibitor. The corrosion inhibitor includes a pyrazolopyridine derivative. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety.

This, and other aspects, can include one or more of the following features. In some implementations, the aldehyde is 4-methoxy benzaldehyde. In some implementations, the first mixture is exposed to ultrasound irradiation at room temperature for about 10 minutes. In some implementations, the second mixture is exposed to ultrasound irradiation at a temperature of about 50 degrees Celsius (° C.) for at least 2 hours. In some implementations, the third mixture is exposed to ultrasound irradiation at room temperature for about 15 minutes. In some implementations, the phenyl moiety includes an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group. In some implementations, the R₁ group includes methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime. In some implementations, the first pyrazole moiety includes an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group. In some implementations, the second pyrazole moiety includes an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group.

The details of one or more implementations of the subject matter of this disclosure are set forth in the accompanying drawings and the description. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an example well.

FIG. 2 is a method for inhibiting corrosion in the well of FIG. 1 .

FIG. 3 is a method for producing a corrosion inhibitor that can be used in the well of FIG. 1 .

FIG. 4 is a Fourier-transform infrared spectroscopy (FTIR) spectrum of an example corrosion inhibitor.

FIG. 5 is a proton nuclear magnetic resonance (¹H NMR) spectrum of an example corrosion inhibitor.

FIG. 6 is a Carbon-13 nuclear magnetic resonance (¹³C NMR) spectrum of an example corrosion inhibitor.

FIG. 7 is a thermal gravimetric analysis (TGA) spectrum of an example corrosion inhibitor.

FIG. 8 is a plot of corrosion rate against time for a linear polarization resistance (LPR) test of an example corrosion inhibitor.

DETAILED DESCRIPTION

FIG. 1 depicts an example well 100 constructed in accordance with the concepts herein. The well 100 extends from the surface 106 through the Earth 108 to one more subterranean zones of interest 110 (one shown). The well 100 enables access to the subterranean zones of interest 110 to allow recovery (that is, production) of fluids to the surface 106 (represented by flow arrows in FIG. 1 ) and, in some implementations, additionally or alternatively allows fluids to be placed in the Earth 108. In some implementations, the subterranean zone 110 is a formation within the Earth 108 defining a reservoir, but in other instances, the zone 110 can be multiple formations or a portion of a formation. The subterranean zone can include, for example, a formation, a portion of a formation, or multiple formations in a hydrocarbon-bearing reservoir from which recovery operations can be practiced to recover trapped hydrocarbons. In some implementations, the subterranean zone includes an underground formation of naturally fractured or porous rock containing hydrocarbons (for example, oil, gas, or both). In some implementations, the well can intersect other types of formations, including reservoirs that are not naturally fractured. For simplicity's sake, the well 100 is shown as a vertical well, but in other instances, the well 100 can be a deviated well with a wellbore deviated from vertical (for example, horizontal or slanted), the well 100 can include multiple bores forming a multilateral well (that is, a well having multiple lateral wells branching off another well or wells), or both.

In some implementations, the well 100 is a gas well that is used in producing hydrocarbon gas (such as natural gas) from the subterranean zones of interest 110 to the surface 106. While termed a “gas well,” the well need not produce only dry gas, and may incidentally or in much smaller quantities, produce liquid including oil, water, or both. In some implementations, the well 100 is an oil well that is used in producing hydrocarbon liquid (such as crude oil) from the subterranean zones of interest 110 to the surface 106. While termed an “oil well,” the well not need produce only hydrocarbon liquid, and may incidentally or in much smaller quantities, produce gas, water, or both. In some implementations, the production from the well 100 can be multiphase in any ratio. In some implementations, the production from the well 100 can produce mostly or entirely liquid at certain times and mostly or entirely gas at other times. For example, in certain types of wells it is common to produce water for a period of time to gain access to the gas in the subterranean zone. The concepts herein, though, are not limited in applicability to gas wells, oil wells, or even production wells, and could be used in wells for producing other gas or liquid resources or could be used in injection wells, disposal wells, or other types of wells used in placing fluids into the Earth.

The wellbore of the well 100 is typically, although not necessarily, cylindrical. All or a portion of the wellbore is lined with a tubing, such as casing 112. The casing 112 connects with a wellhead at the surface 106 and extends downhole into the wellbore. The wellhead defines an attachment point for other equipment to be attached to the well 100. For example, FIG. 1 shows well 100 being produced with a Christmas tree attached to the wellhead. The Christmas tree includes valves used to regulate flow into or out of the well 100. The casing 112 operates to isolate the bore of the well 100, defined in the cased portion of the well 100 by the inner bore 116 of the casing 112, from the surrounding Earth 108. The casing 112 can be formed of a single continuous tubing or multiple lengths of tubing joined (for example, threadedly) end-to-end. In FIG. 1 , the casing 112 is perforated in the subterranean zone of interest 110 to allow fluid communication between the subterranean zone of interest 110 and the bore 116 of the casing 112. In some implementations, the casing 112 is omitted or ceases in the region of the subterranean zone of interest 110. This portion of the well 100 without casing is often referred to as “open hole.”

A composition including a corrosion inhibitor, as described in this disclosure, can be flowed into the wellbore of the well 100 to inhibit corrosion in the wellbore. In particular, the composition including the corrosion inhibitor described in this disclosure can be flowed into the wellbore of the well 100 to inhibit high temperature carbon dioxide corrosion. The composition includes a pyrazolopyridine derivative. The pyrazolopyridine derivative is the corrosion inhibitor. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety. In some implementations, the pyrazolopyridine derivative (corrosion inhibitor) has a concentration in the composition in a range of from 100 parts per million (ppm) to 10,000 ppm.

In some implementations, the phenyl moiety includes an R₁ group selected from the group consisting of a methoxy group (—OCH₃), a carboxyl group (—COOH), an aromatic amide group, a thiol group (—SH), a nitrile group (—CN), an azo group (—NNR′, where R′ can be aryl or alkyl), a pyridyl group, a bromophenyl group, and a sulfonic acid group (—SO₃H). In some implementations, the R₁ group includes methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime.

In some implementations, the first pyrazole moiety includes an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group (—OH), a methyl amino group, an amide group, and an ester group. In some implementations, the second pyrazole moiety includes an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group (—NH₂), a thiol group, a hydroxyl group, an ester group, and a carboxyl group. In some implementations, the R₂ group and the R₃ group are the same. In some implementations, the R₂ group and the R₃ group are different.

The subject matter described in this disclosure can be implemented in particular implementations, so as to realize one or more of the following advantages. The pyrazolopyridine derivative (corrosion inhibitor) can be used to mitigate and/or eliminate corrosion in sweet gas and oil fields, and especially for high temperature applications. Mitigating and/or eliminating corrosion using the pyrazolopyridine derivative can extend service life of tubings (for example, completion tubings) in a well. The corrosion inhibitor (pyrazolopyridine derivative) described in this disclosure is capable of maintaining its corrosion inhibiting efficiency at temperatures greater than 100 degrees Celsius (° C.). The corrosion inhibitor (pyrazolopyridine derivative) described in this disclosure can protect steel at temperatures of up to 130° C.

FIG. 2 is a method 200 for inhibiting corrosion in a well, for example, the well 100 of FIG. 1 . At step 202, a composition is flowed into a wellbore formed in a subterranean formation, such as the wellbore of well 100. By flowing the composition into the wellbore at step 202, corrosion is inhibited in the wellbore. As mentioned previously, the composition includes a pyrazolopyridine derivative, which is the corrosion inhibitor. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety. In some implementations, the composition is flowed into the wellbore in batches (for example, batch treatment) at step 202. In some implementations, the composition is flowed into the wellbore continuously (for example, continuous injection) at step 202. At step 204, a hydrocarbon (for example, a hydrocarbon gas, a hydrocarbon liquid, or a combination of both) is produced from the subterranean formation via the wellbore of well 100.

FIG. 3 is a method 300 for producing the corrosion inhibitor (pyrazolopyridine derivative) that can be used in the well 100 of FIG. 1 . At step 302 a, hydrazine hydrate and ethyl acetoacetate is mixed in ethanol to form a first mixture. At step 302 b, the first mixture is exposed to ultrasound irradiation. In some implementations, the first mixture is exposed to ultrasound irradiation at room temperature (for example, about 20° C.) for about 10 minutes at step 302 b.

At step 304 a, an aldehyde and ammonium acetate is added to the first mixture to form a second mixture. In some implementations, the aldehyde is 4-methoxy benzaldehyde. At step 304 b, the second mixture is exposed to ultrasound irradiation. In some implementations, the second mixture is exposed to ultrasound irradiation at a temperature of about 50° C. for at least 2 hours at step 304 b.

At step 306 a, water is added to the second mixture to form a third mixture. At step 306 b, the third mixture is exposed to ultrasound irradiation to form a precipitate. In some implementations, the third mixture is exposed to ultrasound irradiation at room temperature for about 15 minutes at step 306 b.

At step 308, the precipitate is separated from the third mixture. For example, the precipitate is filtered from the third mixture at step 308.

At step 310, the precipitate is crystallized using ethanol to form the corrosion inhibitor. The corrosion inhibitor includes a pyrazolopyridine derivative. The pyrazolopyridine derivative includes a pyridyl moiety, a first pyrazole moiety, a second pyrazole moiety, and a phenyl moiety. The first pyrazole moiety is bound to the pyridyl moiety. The second pyrazole moiety is bound to the pyridyl moiety. The phenyl moiety is bound to the pyridyl moiety. In some implementations, the precipitate is washed with water and then dried and crystallized using ethanol at step 310.

Example

Hydrazine hydrate (2.0 millimoles (mmol)) and ethyl acetoacetate (2.0 mmol) was mixed in 15 milliliters (mL) of ethanol to form a first mixture (step 302 a). The first mixture was irradiated by an ultrasonicator for 10 minutes at room temperature (step 302 b). 4-methoxy aldehyde (1.0 mmol) and ammonium acetate (1.0 mmol) was added to the first mixture to form a second mixture (step 304 a). The second mixture was irradiated by the ultrasonicator for 2.5 hours at 50° C. at a sonication power of 450 Watts (W) (step 304 b). The extent of reaction completion was monitored. The second mixture was cooled to room temperature. Water (10 mL) was added to the second mixture to form a third mixture (step 306 a). The third mixture was irradiated by the ultrasonicator for 15 minutes at room temperature (step 306 b). The precipitated product was filtered from the third mixture (step 308). The precipitated product was washed with water, dried with ethanol, and crystallized from ethanol (step 310). The yield was 96%. The melting point of the crystallized product (pyrazolopyridine derivative, which is the corrosion inhibitor) was 206° C. The structural characterization of the synthesized pyrazolopyridine derivative (corrosion inhibitor) was performed using Fourier-transform infrared (FTIR) and nuclear magnetic resonance (NMR) spectroscopy (shown in FIGS. 4, 5, and 6 ). The thermal stability of the synthesized pyrazolopyridine derivative (corrosion inhibitor) was studied using thermal gravimetric analysis (TGA) (shown in FIG. 7 ).

FIG. 4 is an FTIR spectrum 400 of the pyrazolopyridine derivative (corrosion inhibitor). The characteristic bands and the values of the corresponding wave number are indicated in FIG. 4 and are as follows: ν_(max). (KBr) 3322 (NH stretching); 3059, 2911 (CH stretching); 1640, 1596 (C═C stretching); 1511, 1492, 1439, 1391, 1259, 1242, 1201 (aromatic stretching); 1026 (aromatic deform); 870, 833, 791, and 731 cm⁻¹.

FIG. 5 is a proton (¹H) NMR spectrum 500 of the corrosion inhibitor (pyrazolopyridine derivative). The peaks are indicated in FIG. 5 and are as follows; δ_(H) (DMSO-d₆): 2.01 (6H, s), 3.58 (3H, s), 4.77 (1H, s), 6.77 (2H, d), and 7.03 (2H, d).

FIG. 6 is a Carbon-13 (¹³C) NMR spectrum 600 of the pyrazolopyridine derivative (corrosion inhibitor). The peaks are indicated in FIG. 6 and are as follows; δ_(C) (DMSO-d₆): 10.83 (2C), 32.39 (1C), 55.41 (1C), 104.9 (2C), 113.6 (2C), 128.8 (2C), 135.7 (1C), 140.1 (2C), 157.6 (2C), and 161.5 (2C).

FIG. 7 is a TGA spectrum 700 of the pyrazolopyridine derivative (corrosion inhibitor). The curve of the TGA spectrum 700 indicates no weight loss in an extended range of temperatures. A steep decline in the weight beyond 240° C. may be linked to the removal of functional groups. Overall, the pyrazolopyridine derivative (corrosion inhibitor) is thermally stable up to about 240° C.

Corrosion Bubble Test

In the bubble test, the performance of the corrosion inhibitor active was tested according to the G3 and G59 ASTM standards. A carbon steel (C-1018) coupon was used for corrosion testing. The test was carried out at 55° C. in a 3.5% sodium chloride (NaCl) solution. Carbon dioxide (CO₂) gas was bubbled through the brine solution for the first two hours to de-aerate and was continuously bubbled throughout the experiment to simulate sweet corrosive condition. The solution was continuously stirred at a flow speed of 500 rpm throughout the test. After 2 hours of purging CO₂ with gas, the measurement of the corrosion rate of the carbon steel coupon using linear polarization resistance (LPR) was initiated, and the corrosion rate was recorded automatically every 10 minutes. The carbon steel coupon (exposed area of 3.5 square centimeters (cm²)) was subjected to pre-corrosion for 2 hours before injecting the corrosion inhibitor (pyrazolopyridine derivative). A concentration of 100 ppm of the pyrazolopyridine derivative (corrosion inhibitor) was used to evaluate its performance in inhibiting corrosion. The test conditions are provided in Table 1. The test results were then monitored for 24 hours to allow for the corrosion rate to stabilize. The corrosion inhibiting performance was then calculated as percent corrosion protection with respect to the uninhibited baseline corrosion rate (C_(Ru)) and the inhibited corrosion rate (C_(Ri)) during the 2-hour pre-corrosion period before the addition of the pyrazolopyridine derivative (Equation 1).

$\begin{matrix} {{\%{Corrosion}{Protection}} = {\frac{C_{Ru} - C_{Ri}}{C_{Ru}} \times 100\%}} & (1) \end{matrix}$

TABLE 1 Corrosion Bubble Test Conditions Brine Solution 3.5% NaCl Temperature 55 ± 2° C. Flow Speed 500 revolutions per minute (rpm) Test Duration 24 hours CO₂ Purging 100% Solution pH 3.8-4.4 Pre-corrosion Duration 2 hours Corrosion Inhibitor Concentration 100 ppm

High Temperature/High Pressure Dynamic Autoclave Test (Weight Loss)

The autoclave test was used to study the performance of the pyrazolopyridine derivative (corrosion inhibitor) at high-temperature, high-pressure, and high-shear stress. A pre-weighed carbon steel (C-1018) coupon was suspended on the head of the autoclave and immersed in 3 liters (L) of 3.5% NaCl test solution. The autoclave was then sealed, de-aerated with nitrogen gas for 1 hour and then pressurized to a pressure of 350 pounds per square inch gauge (psig) (2.4 megapascals (MPa)) with CO₂ and heated to 130° C. A flow speed of 1,500 rpm was employed to induce typically high shear stress, and the coupons were exposed for 24 hours. The parameters used for the weight loss test are provided in Table 2. A corrosion inhibitor concentration of 500 ppm was used to evaluate the corrosion inhibiting performance of the pyrazolopyridine derivative under these conditions. After 24 hours, the coupons were removed, cleaned with Super Clark's solution (5 grams per liter (g/L) of N,N-dibutylthiourea dissolved in 18% hydrogen chloride (HCl)), and re-weighed. The corrosion rate in millimeters per year (mm/yr) was calculated according to Equation 2 (ASTM standard: Designation G 1).

$\begin{matrix} {{{Corrosion}{rate}\left( {{mm}/{yr}} \right)} = \frac{W \times 87,600}{A \times T \times D}} & (2) \end{matrix}$

where W is weight loss in grams (g), A is the exposed surface area in cm², Tis the time of exposure in hours, and D is the density in grams per cubic centimeters (g/cm³) (7.86 g/cm³ for carbon steel).

TABLE 2 Weight Loss Test Conditions Brine Solution 3.5% NaCl Temperature 130 ± 2° C. CO₂ Partial Pressure 2.4 MPa (350 psig) Flow Speed 1500 rpm Test Duration 24 hours Corrosion Inhibitor Concentration 500 ppm

FIG. 8 is a plot 800 of corrosion rate against time for a linear polarization resistance (LPR) test on carbon steel coupons over a period of 24 hours with addition of the corrosion inhibitor (pyrazolopyridine derivative). The corrosion inhibitor (pyrazolopyridine derivative) was injected after subjecting the coupons to 2 hours of pre-corrosion. After injecting the corrosion inhibitor (pyrazolopyridine derivative), the corrosion rate of 140.8 mils per year (mpy) of the coupons during pre-corrosion decreased in the presence of the corrosion inhibitor (pyrazolopyridine derivative) to 2.65 mpy after 24 hours, exhibiting a corrosion inhibiting efficiency of 98.12%.

Table 3 shows the corrosion rates and the corresponding corrosion inhibition efficiency. The determination of the weight loss using the weight loss test was conducted for 24 hours. The corrosion rate of the blank (control) was 4667 mpy. For the inhibited active sample with the corrosion inhibitor (pyrazolopyridine derivative), the corrosion rate dropped to 2190 mpy. The corresponding corrosion inhibiting efficiency was 53.08%. The presence of the pyrazolopyridine derivative (corrosion inhibitor) reduces the corrosion rate of steel by more than half at a concentration of 500 ppm under severe conditions, for example, at a temperature of 130° C. (high temperature), a pressure of 350 psig (high pressure), and a flow speed of 1,500 rpm (representing high shear).

TABLE 3 Weight Loss Test Results Corrosion Corrosion Corrosion Rate Rate Inhibiting (mpy) (mm/yr) Efficiency (%) Control 4,667 118.49 N/A With Corrosion Inhibitor 2,190 55.60 53.08

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular implementations. Certain features that are described in this specification in the context of separate implementations can also be implemented, in combination, in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations, separately, or in any sub-combination. Moreover, although previously described features may be described as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can, in some cases, be excised from the combination, and the claimed combination may be directed to a sub-combination or variation of a sub-combination.

As used in this disclosure, the terms “a,” “an,” or “the” are used to include one or more than one unless the context clearly dictates otherwise. The term “or” is used to refer to a nonexclusive “or” unless otherwise indicated. The statement “at least one of A and B” has the same meaning as “A, B, or A and B.” In addition, it is to be understood that the phraseology or terminology employed in this disclosure, and not otherwise defined, is for the purpose of description only and not of limitation. Any use of section headings is intended to aid reading of the document and is not to be interpreted as limiting; information that is relevant to a section heading may occur within or outside of that particular section.

As used in this disclosure, the term “about” or “approximately” can allow for a degree of variability in a value or range, for example, within 10%, within 5%, or within 1% of a stated value or of a stated limit of a range.

As used in this disclosure, the term “substantially” refers to a majority of, or mostly, as in at least about 50%, 60%, 70%, 80%, 90%, 95%, 96%, 97%, 98%, 99%, 99.5%, 99.9%, 99.99%, or at least about 99.999% or more.

Values expressed in a range format should be interpreted in a flexible manner to include not only the numerical values explicitly recited as the limits of the range, but also to include all the individual numerical values or sub-ranges encompassed within that range as if each numerical value and sub-range is explicitly recited. For example, a range of “0.1% to about 5%” or “0.1% to 5%” should be interpreted to include about 0.1% to about 5%, as well as the individual values (for example, 1%, 2%, 3%, and 4%) and the sub-ranges (for example, 0.1% to 0.5%, 1.1% to 2.2%, 3.3% to 4.4%) within the indicated range. The statement “X to Y” has the same meaning as “about X to about Y,” unless indicated otherwise. Likewise, the statement “X, Y, or Z” has the same meaning as “about X, about Y, or about Z,” unless indicated otherwise.

Particular implementations of the subject matter have been described. Other implementations, alterations, and permutations of the described implementations are within the scope of the following claims as will be apparent to those skilled in the art. While operations are depicted in the drawings or claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed (some operations may be considered optional), to achieve desirable results. In certain circumstances, multitasking or parallel processing (or a combination of multitasking and parallel processing) may be advantageous and performed as deemed appropriate.

Moreover, the separation or integration of various system modules and components in the previously described implementations should not be understood as requiring such separation or integration in all implementations, and it should be understood that the described components and systems can generally be integrated together or packaged into multiple products.

Accordingly, the previously described example implementations do not define or constrain the present disclosure. Other changes, substitutions, and alterations are also possible without departing from the spirit and scope of the present disclosure. 

What is claimed is:
 1. A composition for inhibiting corrosion in gas wells, the composition comprising: a pyrazolopyridine derivative comprising: a pyridyl moiety; a first pyrazole moiety bound to the pyridyl moiety; a second pyrazole moiety bound to the pyridyl moiety; and a phenyl moiety bound to the pyridyl moiety.
 2. The composition of claim 1, wherein the pyrazolopyridine derivative has a concentration in the composition in a range of from 100 parts per million (ppm) to 10,000 ppm.
 3. The composition of claim 2, wherein the phenyl moiety comprises an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group.
 4. The composition of claim 3, wherein the R₁ group comprises methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime.
 5. The composition of claim 3, wherein the first pyrazole moiety comprises an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group.
 6. The composition of claim 5, wherein the second pyrazole moiety comprises an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group.
 7. A method comprising: flowing a composition into a wellbore formed in a subterranean formation, thereby inhibiting corrosion in the wellbore, the composition comprising a pyrazolopyridine derivative comprising: a pyridyl moiety; a first pyrazole moiety bound to the pyridyl moiety; a second pyrazole moiety bound to the pyridyl moiety; and a phenyl moiety bound to the pyridyl moiety; and producing a hydrocarbon from the subterranean formation via the wellbore.
 8. The method of claim 7, wherein the pyrazolopyridine derivative has a concentration in the composition in a range of from 100 parts per million (ppm) to 10,000 ppm.
 9. The method of claim 8, wherein the phenyl moiety comprises an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group.
 10. The method of claim 9, wherein the R₁ group comprises methoxy, mercapto, pyridyl, (bromomethyl)pyridyl, or pyridine-2-aldoxime.
 11. The method of claim 9, wherein first pyrazole moiety comprises an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group.
 12. The method of claim 11, wherein the second pyrazole moiety comprises an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group.
 13. A method for producing a corrosion inhibitor for gas wells, the method comprising: mixing hydrazine hydrate and ethyl acetoacetate in ethanol to form a first mixture; exposing the first mixture to ultrasound irradiation; adding an aldehyde and ammonium acetate to the first mixture to form a second mixture; exposing the second mixture to ultrasound irradiation; adding water to the second mixture to form a third mixture; exposing the third mixture to ultrasound irradiation to form a precipitate; separating the precipitate from the third mixture; and crystallizing the precipitate using ethanol to form the corrosion inhibitor, wherein the corrosion inhibitor comprises a pyrazolopyridine derivative comprising: a pyridyl moiety; a first pyrazole moiety bound to the pyridyl moiety; a second pyrazole moiety bound to the pyridyl moiety; and a phenyl moiety bound to the pyridyl moiety.
 14. The method of claim 13, wherein the aldehyde is 4-methoxy benzaldehyde.
 15. The method of claim 14, wherein the first mixture is exposed to ultrasound irradiation at room temperature for about 10 minutes.
 16. The method of claim 15, wherein the second mixture is exposed to ultrasound irradiation at a temperature of about 50 degrees Celsius (° C.) for at least 2 hours.
 17. The method of claim 16, wherein the third mixture is exposed to ultrasound irradiation at room temperature for about 15 minutes.
 18. The method of claim 17, wherein the phenyl moiety comprises an R₁ group selected from the group consisting of a methoxy group, a carboxyl group, an aromatic amide group, a thiol group, a nitrile group, an azo group, a pyridyl group, a bromophenyl group, and a sulfonic acid group.
 19. The method of claim 18, wherein first pyrazole moiety comprises an R₂ group selected from the group consisting of an alkyl group, a thiol group, a carboxyl group, an aromatic carbonyl group, a hydroxyl group, a methyl amino group, an amide group, and an ester group.
 20. The method of claim 19, wherein the second pyrazole moiety comprises an R₃ group selected from the group consisting of an alkyl group, an amide group, an amino group, a thiol group, a hydroxyl group, an ester group, and a carboxyl group. 